package fr.fitec.qcmPlus.beans;
	
import java.io.Serializable;
import java.sql.Timestamp;

import fr.fitec.qcmPlus.constants.QcmConstants;

public class Utilisateur implements Serializable {

		private static final long serialVersionUID = 1L;
		
		
		private int idUtilisateur = QcmConstants.ID_INVALIDE;
		private String nom;
		private String prenom;
		private String motdepasse;
		private String societe;
		private String role;
		private String statut;
		private Timestamp date_creation;
		private Timestamp date_maj;
		private Timestamp date_suppr;

		
		
		public Utilisateur(){
		}
		public Utilisateur(String name, String mdp){
			this.nom			=	name;
			this.motdepasse		=	mdp;
		}
		public Utilisateur(int id, String name, String mdp){
			this.idUtilisateur	=	id;
			this.nom			=	name;
			this.motdepasse		=	mdp;
		}
		public Utilisateur(Utilisateur user){
			this.idUtilisateur	=	user.idUtilisateur;
			this.nom			=	user.nom;
			this.prenom			=	user.prenom;
			this.motdepasse		=	user.motdepasse;
			this.societe		=	user.societe;
			this.role			=	user.role;
			this.statut			=	user.statut;
			this.date_creation	=	user.date_creation;
			this.date_maj		=	user.date_maj;
			this.date_suppr		=	user.date_suppr;
		}
        public int getIdUtilisateur() {
			return idUtilisateur;
		}
		public void setIdUtilisateur(int idNom) {
			this.idUtilisateur = idNom;
		}
		public String getNom() {
			return nom;
		}
		public void setNom(String nom) {
			this.nom = nom;
		}
		public String getMotdepasse() {
			return motdepasse;
		}
		public void setMotdepasse(String motdepasse) {
			this.motdepasse = motdepasse;
		}
		public String getRole() {
			return role;
		}
		public void setRole(String role) {
			this.role = role;
		}
		public void setSociete(String societe) {
			this.societe = societe;
		}
		public String getSociete() {
			return societe;
		}
		public void setPrenom(String prenom) {
			this.prenom = prenom;
		}
		public String getPrenom() {
			return prenom;
		}	
		public Timestamp getDate_creation() {
			return date_creation;
		}
		public void setDate_creation(Timestamp dateCreation) {
			date_creation = dateCreation;
		}
		public Timestamp getDate_maj() {
			return date_maj;
		}
		public void setDate_maj(Timestamp dateMaj) {
			date_maj = dateMaj;
		}
		public Timestamp getDate_suppr() {
			return date_suppr;
		}
		public void setDate_suppr(Timestamp dateSuppr) {
			date_suppr = dateSuppr;
		}
		public void setStatut(String statut) {
			this.statut = statut;
		}
		public String getStatut() {
			return statut;
		}
        @Override
        public String toString()
        {
            final StringBuilder sb = new StringBuilder();
            sb.append("id: "+this.getIdUtilisateur()).append("\n");
            sb.append("nom: "+this.getNom()).append("\n");
            sb.append("prenom: "+this.getPrenom()).append("\n");
            sb.append("mdp: "+this.getMotdepasse()).append("\n");
            sb.append("societe: "+this.getSociete()).append("\n");
            sb.append("role: "+this.getRole()).append("\n");
            sb.append("statut: "+this.getStatut()).append("\n");
            sb.append("date creation: "+this.getDate_creation()).append("\n");
            sb.append("date maj: "+this.getDate_maj()).append("\n");
            sb.append("date suppr: "+this.getDate_suppr());
            return sb.toString();
        }
		
	}
